#ifndef FTMULTIBUTTON_H
#define FTMULTIBUTTON_H

#include <QtGui>
#include <QSystemDeviceInfo>
#include "ftbasicwidget.h"

QTM_USE_NAMESPACE

class FTMultiButton : public FTBasicWidget
{
    Q_OBJECT
public:
    // auto: the multiutton will select the button clicked by the user
    // manual: the caller must call selectButton slot to select a button, always.
    enum multiMode { auto_select, manual_select };

    explicit FTMultiButton(FTControls::IconSize, FTMultiButton::multiMode);

    // Show also the clock on the title bar
    void enableClock(bool);
    bool clockEnabled() const;

    // Add buttons to the multibutton
    void addButtonLeft( int, const QImage&, const QString& );
    void addButtonRight( int, const QImage&, const QString& );

    void paintEvent(QPaintEvent *);
    void mouseReleaseEvent(QMouseEvent *);
    void timerEvent(QTimerEvent *);

    QSize sizeHint() const;
    QSize minimumSizeHint() const;

    int selectedIndex() const;

    void setImage( int, const QImage& );
    void setText( int, const QString& );

signals:
    void clicked(int);

public slots:
    void selectButton(int);

private:
    // This is the size of the icons!
    QSize base_size;

    QList<QImage> images;
    QList<QString> titles;
    QList<int> ids;

    QSystemDeviceInfo *deviceInfo;

    int selected;
    int totalWidth;
    int clock_timer;
    bool useClock;

};

#endif // FTMULTIBUTTON_H
